package co.yixiang.modules.shop.web.controller;

import co.yixiang.common.api.ApiResult;
import co.yixiang.modules.shop.entity.YxSales;
import co.yixiang.modules.shop.service.impl.YxSalesService;
import co.yixiang.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author frq
 * @date 2020-05-29
 */
@Slf4j
@Api(tags = "投资端:授权:用户授权中心")
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping(value = "/api")
public class InvestmentController {

    private final YxSalesService yxSalesService;

    @ApiOperation(value = "获取用户信息")
    @GetMapping(value = "/sales/info")
    public ApiResult getSalesInfo() {
        YxSales yxSales = yxSalesService.getById(SecurityUtils.getUserId());
        return ApiResult.ok(yxSales);
    }
}
